package com.minelx.scriptbuilder.script;

import com.minelx.scriptbuilder.script.attribute.value.Attribute;
import com.minelx.scriptbuilder.script.attribute.value.IAttribute;

import java.util.List;

public class FunctionFrame {

	private final IAttribute params;

	private IAttribute returnValue;

	public FunctionFrame(List<String> names, List<IAttribute> values) {
		params = new Attribute();
		for (int at = 0; at < names.size(); at++) {
			params.set(names.get(at), values.get(at));
		}
		returnValue = IAttribute.nil();
	}

	public IVariable param(String name) {
		return params.get(name);
	}

	public void returns(IAttribute returnValue) {
		this.returnValue = returnValue;
	}

	public IAttribute returns() {
		return returnValue;
	}
}
